Skip to content

Conversation

@weissi
Copy link
Contributor

@weissi weissi commented May 13, 2021

Motivation:

In the vast majority of cases, we'll only ever create one and only one
NIOSSLContext. It's therefore wasteful to keep around a whole thread
doing nothing just for that. A DispatchQueue is absolutely fine here.

Modification:

Run the NIOSSLContext creation on a DispatchQueue instead.

Result:

Fewer threads hanging around.

@weissi weissi requested review from Lukasa and glbrntt May 13, 2021 13:45
@Lukasa Lukasa added the 🔨 semver/patch No public API change. label May 13, 2021
@weissi weissi force-pushed the jw-dq-for-context branch 2 times, most recently from 4ac7ef2 to 6db559a Compare May 13, 2021 13:54
@weissi weissi force-pushed the jw-dq-for-context branch from 6db559a to 04e65d1 Compare May 13, 2021 14:03
@weissi weissi requested a review from Lukasa May 13, 2021 14:04
Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay. Less code to maintain. Thanks! 🥳

Motivation:

In the vast majority of cases, we'll only ever create one and only one
`NIOSSLContext`. It's therefore wasteful to keep around a whole thread
doing nothing just for that. A `DispatchQueue` is absolutely fine here.

Modification:

Run the `NIOSSLContext` creation on a `DispatchQueue` instead.

Result:

Fewer threads hanging around.
@weissi weissi force-pushed the jw-dq-for-context branch from 04e65d1 to 63e9a46 Compare May 13, 2021 14:08
@weissi weissi merged commit 8ccba73 into swift-server:main May 13, 2021
@weissi weissi deleted the jw-dq-for-context branch May 13, 2021 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants